package com.gxa.weixing.core.pojo;


import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author 18380
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
@Table(name = "tb_order")
public class Order implements Serializable {
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name = "order_id")
  @ApiModelProperty(name = "orderId", value = "订单表编号", dataType = "Long", example = "1")
  private Long orderId;

  @Column(name = "user_id")
  @ApiModelProperty(name = "orderGoodId", value = "用户编号", dataType = "Long", example = "1")
  private Long userId;

  @Column(name = "order_no")
  @ApiModelProperty(name = "orderNo", value = "商品订单编号", dataType = "Long", example = "1")
  private String orderNo;

  @Column(name = "status")
  @ApiModelProperty(name = "status", value = "订单状态:0代付款,1待发货,2待收货,3已完成,4退款/售后", dataType = "Long",example = "1")
  private Integer status;

  @Column(name = "order_time")
  @ApiModelProperty(name = "orderTime", value = "商品订单表编号", dataType = "Date", example = "2021-12-5 12:56:12")
  @JsonFormat(pattern = "YYYY-MM-dd HH:mm:ss",timezone = "GMT+8")
  private Date orderTime;

  @Column(name = "address_id")
  @ApiModelProperty(name = "addressId", value = "地址编号", dataType = "Long", example = "1")
  private long addressId;

  @Column(name = "rule_id")
  @ApiModelProperty(name = "ruleId", value = "运费模板表编号", dataType = "Long", example = "3")
  private Long ruleId;

  @Column(name = "pay_no")
  @ApiModelProperty(name = "payNo", value = "支付流水号", dataType = "Long", example = "1")
  private String payNo;

  @Column(name = "pay_status")
  @ApiModelProperty(name = "payStatus", value = "是否付款", dataType = "Boolean", example = "true")
  private Boolean payStatus;

  @Column(name = "pay_price")
  @ApiModelProperty(name = "payPrice", value = "支付金额", dataType = "BigDecimal", example = "1")
  private BigDecimal payPrice;

  @Column(name = "pay_freight")
  @ApiModelProperty(name = "payFreight", value = "运费", dataType = "BigDecimal", example = "1")
  private BigDecimal payFreight;

  private List<OrderGoods> orderGoods;

  private Address address;



}
